<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>e网生活管理后台</title>
  <?php  include("common/conn.php");
  if($_SESSION['userid']==""){
    echo "<script>window.location.href='login.php';</script>";
  } 

  if($_GET['del']=="ok")
  {
    $area = array(); 
    $area= $_POST['checkbox'];

    foreach ($area as $k=>$v)
    {
      $srat1=mysql_query("DELETE FROM categroy_type where id='".$v."'");
    }

  }

  ?>
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <link href="css/styles.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="js/scripts.js"></script>	
</head>

<body>
  <!--header-->
  <?php include("common/header.php");?>
  <!--header end-->
  <div id="sub_nav">

    <div id="subnav_wrap" class="container_12">
      <div id="subnav" class=" grid_12">
        <ul>
          <li> <a href="fenlei.php"> 分类管理 </a></li>
          <li><a href="fenlei_leixing.php" class="sub_nav_active" >分类属性</a></li>
          <li><a href="ordersFirst.php" >首单返券</a></li>
        </ul>
      </div>
    </div>


  </div>
  <div class="container_12">
    <input type="button" class="submit" value="新增分类类型" onclick="add();">
  </form>
</div>
<!-- end sub_nav -->
<form action="?del=ok" method="post">
  <!-- EVERYTING BELOW IS THE MAIN CONTENT -->

  <div class="container_12">

    <table width="100%" border="0" cellpadding="0" cellspacing="0">



      <tr>

        <th width="5%" scope="col">
          <input type="checkbox" name="checkbox" id="checkbox" class="checkall" />
          <label for="checkbox"></label></th>
          <th width="13%" scope="col">id</th>
          <th width="15%" scope="col">分类属性</th>
          <th width="15%" scope="col">返回率</th>
          <th width="13%" scope="col">支持海淘</th>
          <th width="13%" scope="col">支持快购</th>
          <th width="13%" scope="col">操作</th>
        </tr>

        <?php 
        mysql_query('SET NAMES UTF8');  

        $ren="1";
        $sex="0";
$perNumber=10; //每页显示的记录数
$page=$_GET['page']; //获得当前的页面值


$count=mysql_query("select count(*) from categroy_type ");


//获得记录总数
$rs=mysql_fetch_array($count); 
$totalNumber=$rs[0];
$totalPage=ceil($totalNumber/$perNumber); //计算出总页数

if (!isset($page)) {
  $page=1;
} //如果没有值,则赋值1
$startCount=($page-1)*$perNumber; //分页开始,根据此方法计算出开始的


$rert30=mysql_query("select * from categroy_type  order by id desc limit $startCount,$perNumber");

while($sdg30=mysql_fetch_array($rert30)){

  ?>

  <tr>

    <td scope="col">
      <input type="checkbox" name="checkbox[]" id="checkbox"  value="<?php echo $sdg30[id];?>"/>
    </td>
    <td scope="col"><?php echo $sdg30[id];?></td>
    <td scope="col"><?php echo $sdg30[type];?></td>
    <td scope="col"><?php echo $sdg30[rates];?></td>
    <td scope="col">
      <?php 
      if ($sdg30[support_ht]==0) {
        echo "否";
      }else{
        echo "是";
      } ;
      ?></td>
      <td scope="col">
        <?php 
        if ($sdg30[support_kg]==0) {
          echo "否";
        }else{
          echo "是";
        } ;
        ?></td>
        <td scope="col"><div class="youse">
          <a href="addfenleiLeixing.php?id=<?php echo $sdg30[id];?>">
            <span class="colorw">编辑</span></a></div>
          </td>
        </tr>


        <?php }?>
      </table>

      <!-- END TABULAR DATA EXAMPLE -->



      <div class="grid_12">

        <div class="clearfix"><input name="" type="submit" value="删除选中" class="submit"/></div>

        <ul id="pagination">



          <?php  

          if ($page > 1) { //上一页 ?>
          <li><a     href="?page=1&keywords=<?php echo $_REQUEST[keywords]; ?>">首页</a></li>
          <li><a     href="?page=<?php echo ($page-1); ?>&keywords=<?php echo $_REQUEST[keywords]; ?>">上一页</a></li>
          <?php }

          ?>

          <li class="active"><?php echo $page;?></li>

          <?php



          if ($_GET[page]!=$totalPage) { //下一页 ?>
          <li><a     href="?page=<?php echo ($page+1); ?>&keywords=<?php echo $_REQUEST[keywords]; ?>">下一页</a></li>
          <?php }

          if ($totalPage>1) { //下一页 ?>
          <li><a     href="?page=<?php echo $totalPage; ?>&keywords=<?php echo $_REQUEST[keywords]; ?>">尾页</a></li>

          <?php }?>


        </ul>

      </div>           







    </div>

    <!-- end content wrap -->

  </form>
</body>
<script type="text/javascript">
  function add(){
    window.location.href="addfenleiLeixing.php";
  }
</script>
</html>